﻿using Basic.FormRemoteModel.QueryColumn;
using Basic.FormRemoteModel.QueryColumn.Model;
using Basic.FormService.Interface;
using WeDonekRpc.Client.Interface;

namespace Basic.FormService.RpcEvent
{
    internal class PhyQueryColumnEvent : IRpcApiService
    {
        private readonly IPhyQueryColumnService _Service;

        public PhyQueryColumnEvent ( IPhyQueryColumnService service )
        {
            this._Service = service;
        }

        public long AddPhyQueryColumn ( AddPhyQueryColumn data )
        {
            return this._Service.Add(data.Datum);
        }

        public void DeletePhyQueryColumn ( DeletePhyQueryColumn obj )
        {
            this._Service.Delete(obj.Id);
        }

        public QueryColumnDto GetPhyQueryColumn ( GetPhyQueryColumn obj )
        {
            return this._Service.Get(obj.Id);
        }

        public bool SetPhyQueryColumn ( SetPhyQueryColumn obj )
        {
            return this._Service.Set(obj.Id, obj.Datum);
        }

        public bool SetPhyQueryColumnSort ( SetPhyQueryColumnSort obj )
        {
            return this._Service.SetSort(obj.Sort);
        }
    }
}
